package main

import "fmt"

func main() {

	var my_slice0 = []string{"hello", "world", "node", "vue"}

	fmt.Println("my slice: ", my_slice0)

	arr := [4]string{"hello", "world", "node", "vue"}
	var my_slice1 = arr[1:2]
	var my_slice2 = arr[0:3]
	var my_slice3 = arr[0:2]
	var my_slice4 = arr[0:3]

	fmt.Println("我的数组：", arr)
	fmt.Println("My Slice 1:", my_slice1)
	fmt.Println("My Slice 2:", my_slice2)
	fmt.Println("My Slice 3:", my_slice3)
	fmt.Println("My Slice 4:", my_slice4)

	var MySlice2 = []string{"评估", "评估", "评估", "评估", "评估"}
	fmt.Println(MySlice2)

	fmt.Println("============================================================")

	var intArr = [5]int{12, 3, 4, 5, 67}
	slice1 := intArr[1:3]
	fmt.Println(slice1)
	fmt.Println("intArr[1]地址：", &intArr[1])
	fmt.Println("slice1地址：", &slice1[0])

	foodsSlice3 := make([]string, 6)
	fmt.Println(foodsSlice3)
	fmt.Println(len(foodsSlice3))
	fmt.Println(cap(foodsSlice3))

	foodsSlice4 := make([]string, 6, 8)
	fmt.Println(foodsSlice4)
	fmt.Println(len(foodsSlice4))

	foodsSlice4 = append(foodsSlice4, "1", "2", "3", "5")
	fmt.Println(foodsSlice4)
	fmt.Println(len(foodsSlice4))
	fmt.Println(cap(foodsSlice4))

}
